package com.wyy.mall.tiny.controller;

import com.wyy.mall.tiny.common.api.CommonResult;
import com.wyy.mall.tiny.dto.OrderParam;
import com.wyy.mall.tiny.service.OmsPortalOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * created by 伍猷煜 on 2021/5/25 15:23 星期二
 */
@Controller
@Api(tags = "OmsPortalOrderController", description = "订单管理")
@RequestMapping("/order")
public class OmsPortalOrderController {

    private final OmsPortalOrderService mOmsPortalOrderService;
    @Autowired
    public OmsPortalOrderController(OmsPortalOrderService omsPortalOrderService) {
        mOmsPortalOrderService = omsPortalOrderService;
    }

    @ApiOperation("根据购物车信息生成订单")
    @PostMapping("/generateOder")
    @ResponseBody
    public CommonResult generateOrder(@RequestBody OrderParam orderParam) {
        return mOmsPortalOrderService.generateOrder(orderParam);
    }
}
